<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
 *
 * @author yxx
 * @date 2017-10-12
 */
class Map extends MY_Controller {

	    public function __construct() {
	             parent::__construct();
               
	}
	//返回大网格名称
	public function grid_name()
	{
                         $smallgridid = $this->input->get_post("smallgridid", true);//小网格id
                         if(empty($smallgridid)){
		       exit(json_encode(array('code'=>1,'info'=>'小网格id不能为空')));
		}
		$sql = "SELECT grid_name FROM t_grid g LEFT JOIN t_small_grid sg ON sg.grid_id=g.grid_id WHERE sg.small_grid_id={$smallgridid}";
		$gridname = $this->db->query($sql)->row_array();
		$gridname = $gridname['grid_name'];
		$this->printJson_data($gridname);
             }
}